package com.twu.biblioteca.factory;

import com.twu.biblioteca.Action;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class ActionFactory {
    public BasicAction createAction(Action action) {
        switch (action) {
            case BORROW:
                return BorrowAction.getInstance();
            case RETURN:
                return ReturnAction.getInstance();
            case QUERY:
                return QueryAction.getInstance();
            case USER_INFO:
                return GetUserInfoAction.getInstance();
            default:
                return null;
        }
    }
}
